package com.smartstate.dataManagement.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartstate.dataManagement.entity.DeviceCarePlanEntity;
import com.smartstate.dataManagement.entity.Equipment;
import com.smartstate.dataManagement.entity.LoginLog;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeviceCarePlanMapper extends BaseMapper<DeviceCarePlanEntity> {

    List<DeviceCarePlanEntity> getPlanByNameOrCode(@Param("deviceName") String  deviceName, @Param("deviceCode") String deviceCode);


    int addPlan(String deviceId,String deviceName,String isAdd,String planTime,String createUser,String createTime,String careCycle);

    @Delete("delete   from  device_care_plan  where  id=#{id}")
    int deleteById(@Param("id") String id);

    int batchDelByIds(List<String> ids);

    int updateByID(DeviceCarePlanEntity deviceCarePlanEntity);

    List<Equipment> getDeviceList(@Param("name") String name);

    List<DeviceCarePlanEntity>  getNoUpdate(@Param("isAdd") String isAdd);

    int  addBatchData(List<DeviceCarePlanEntity> deviceCarePlanEntityList);

    int  batchEdit(List<DeviceCarePlanEntity>  list,@Param("isAdd") String isAdd);

    @Update("update  device_care_plan  set isAdd=#{isAdd}  where  id=#{id}")
    int editPlanByID(@Param("id") String id,@Param("isAdd")String isAdd);

    int batchDel(List<DeviceCarePlanEntity> list);

}
